package com.refusea.train.domain.req

import java.time.LocalDate

data class OrderReq(
    var schoolId: Int?,
    val start: LocalDate?,
    var end: LocalDate?,
    val parentId: Int?,
    val studentId: Int?,
    val courseId: Int?,
    val paid: Boolean?,
    val grouped: Boolean?,
    val completed: Boolean?,
    val page: Int,
) {
    var offset: Int = 0
    var limit: Int = 10


    fun calculateOffset(limit: Int) {
        this.offset = (this.page.coerceAtLeast(1) - 1) * limit
        this.limit = limit
    }
}
